#ifndef __CAUDIOIC_CFILE_READER_H__
#define __CAUDIOIC_CFILE_READER_H__


class CFileReader
{
public:
    ECode Init();
    void DeInit();
    ECode OpenToRead(wchar_t* wszInFullPathFileName);
    ECode OpenToWrite(wchar_t* wszInFullPathFileName);
    void Close();
    void SetFileOffset(Uint32 UFileOffset);
    int GetFileOffset();
    ECode ReadFile(Byte *ReadBuffer, int ReadSize, int* pReadedSize);
    ECode WriteFile(Byte *WriteBuffer, int WriteSize, int* pWritedSize);
public:
    int  m_iFileSize;
private:
    IBasicFileSystem *m_pI_FLASH_FileSystem;
    IBasicDirectory *m_pI_FLASH_Directory;
    IBasicFile *m_pIBsFile;
    Uint32 m_uLastOffset;
private:
    FindRootName(wchar_t *pRootDirName);
    InitRoot(wchar_t *pRootDirName);
};

#endif //__CAUDIOIC_CFILE_READER_H__
